import Mock from "mockjs";

export default {
  fetchMenu: config => {
    console.log(config);
    let items = [];
    for (let i = 0; i <= 10; i++) {
      let temp = [];
      for (let k = 0; k <= 3; k++) {
        temp.push({
          id: k + "",
          label: "子导航" + k,
          path: "",
          children: []
        });
      }
      items.push(
        Mock.mock({
          id: i + "",
          label: "导航" + Mock.Random.region(),
          path: Mock.Random.string("lower"),
          children: temp
        })
      );
    }
    return Mock.mock({
      items,
      count: items.count
    });
  }
};
